﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="eppUploadConvMedColetivo.aspx.cs" Inherits="Protegidos_Empresas__popup_eppUploadConvMedColetivo" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register TagPrefix="uc1" TagName="HeadTag"  Src="~/_includes/HeadTag.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <!-- Includes -->
    <uc1:HeadTag ID="HeadTag1" runat="server" />    
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function CloseAndRebind(args)
            {
                GetRadWindow().Close();
                GetRadWindow().BrowserWindow.refreshGrid(args);
            }
    		
            function GetRadWindow()
            {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
    				
                return oWindow;
            }

            function CancelEdit()
            {
                GetRadWindow().Close();		
            }
        </script>
        </telerik:RadCodeBlock>
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rcbFornecedor">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="trLocalidade" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="rcbLocalidade" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="trMensagem" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rcbLocalidade">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="trServico" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="rcbServico" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="trMensagem" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rcbServico">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="trDataEntrega" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="rcbDataEntrega" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="trMensagem" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>   
            </AjaxSettings>
        </telerik:RadAjaxManager>

        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Telerik" >
        </telerik:RadAjaxLoadingPanel> 
        
        <table width="99%" align="right">
            <tr>
                <td>
                    <div class="SuTituloVR">Upload de documento [Protocolo Convênio Médico Coletivo]</div>
                </td>
            </tr>
            <tr runat="server" id="trMsg">
                <td>
                    <p>&nbsp;&nbsp;<span style="font-weight: bold;">Carregue um arquivo de no máximo 300KB</span></p>
                </td>
            </tr>
            <tr id="trMensagem" runat="server" visible="false">
                <td valign="middle" style="background-color:#FFFFAA; height:33px">
                    &nbsp;&nbsp;<asp:Label ID="lblResultado" runat="server" Text="" Font-Names="Verdana" Font-Size="9"></asp:Label>
                    <br />
                </td>
            </tr>  
            <tr>
                <td>
                    <table>
                        <tr id="trFornecedor" runat="server">
                            <td style="width: 150px"><span class="textoCZ_12">Fornecedor:</span></td>
                            <td>
                                <telerik:RadComboBox ID="rcbFornecedor" runat="server" Skin="Telerik" 
                                    Width="280px" Height="160px" EmptyMessage="Selecione" Font-Names="Verdana" AutoPostBack="true"
                                    EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" LoadingMessage="Carregando..." 
                                    OnItemsRequested="rcbFornecedor_ItemsRequested" 
                                    OnSelectedIndexChanged="rcbFornecedor_SelectedIndexChanged">
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr id="trLocalidade" runat="server">
                            <td style="width: 150px"><span class="textoCZ_12">Localidade:</span></td>
                            <td>
                                <telerik:RadComboBox ID="rcbLocalidade" runat="server" Skin="Telerik" 
                                    Width="280px" EmptyMessage="Selecione" AllowCustomText="true" Font-Names="Verdana" AutoPostBack="true"
                                    OnSelectedIndexChanged="rcbLocalidade_SelectedIndexChanged">
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                </telerik:RadComboBox>
                            </td>
                        </tr>             
                    </table>
                    <table>
                        <tr id="trServico" runat="server">
                            <td style="width: 150px"><span class="textoCZ_12">Serviço:</span></td>
                            <td>
                                <telerik:RadComboBox ID="rcbServico" runat="server" Skin="Telerik" 
                                    Width="280px" Height="160px" EmptyMessage="Selecione" Font-Names="Verdana" AutoPostBack="true"
                                    EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" LoadingMessage="Carregando..."
                                    OnItemsRequested="rcbServico_ItemsRequested"
                                    OnSelectedIndexChanged="rcbServico_SelectedIndexChanged">
                                    <CollapseAnimation Type="OutQuint" Duration="200" />
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr id="trDataEntrega" runat="server">
                            <td style="width: 150px"><span class="textoCZ_12">Data de entrega:</span></td>
                            <td>
                                <telerik:RadComboBox ID="rcbDataEntrega" runat="server" Skin="Telerik"
                                    Width="280px" EmptyMessage="Selecione" AllowCustomText="true" Font-Names="Verdana">
                                    <CollapseAnimation Type="OutQuint" Duration="200" />    
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                    
                </td>
            </tr>
            
            <tr>
                <td>
                    <table>
                        <tr runat="server" id="trSeleciona">
                            <td style="width:380px">
                            <br />
                                <telerik:RadUpload ID="RadUpload1" runat="server" 
                                    ControlObjectsVisibility="None"
                                    EnableFileInputSkinning="true" 
                                    InitialFileInputsCount="1" 
                                    Culture="Portuguese (Brazil)" Width="300px" Skin="Telerik" 
                                    MaxFileInputsCount="1"  
                                    AllowedFileExtensions=".pdf" >
                                    <Localization Add="Adicionar" Remove="Remover" Select="Procurar..." />
                                </telerik:RadUpload>
                                
                                <asp:CustomValidator ID="Customvalidator1" runat="server" Display="Dynamic" ClientValidationFunction="validateRadUpload1">
                                <span style="FONT-SIZE: 12px;">Formato inválido!</span>
                                </asp:CustomValidator>
                                <br>
                                <telerik:RadProgressArea id="progressArea1" runat="server" Skin="Default" >
                                    <Localization Uploaded="Enviado" CurrentFileName="Arquivo:" 
                                        ElapsedTime="Tempo:" EstimatedTime="Tempo estimado:" 
                                        TotalFiles="Total de arquivos:" TransferSpeed="Velocidade:" 
                                        UploadedFiles="Arquivos enviados:"></Localization>
                                </telerik:RadProgressArea>
                            </td>
                            <td>
                                <td><asp:Label ID="lblArquivo" runat="server" Text="" Width="30px"></asp:Label></td>
                            </td>
                        </tr>
                        <tr runat="server" id="trResultado">
                            <td>
                                <asp:label id="labelNoResults" runat="server" visible="True">Arquivo não Enviado.</asp:label>
                                <asp:Repeater id="repeaterResults" runat="server" visible="False">
                                    <HeaderTemplate>
                                        Arquivo Enviado.<br />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <span style="font-weight: normal; font-size: 12px; color: black;">
                                            Arquivo:&nbsp;<%#DataBinder.Eval(Container.DataItem, "FileName").ToString()%><br />
                                            Tamanho&nbsp;do&nbsp;Arquivo:&nbsp;<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + "&nbsp;bytes"%><br />
                                            <br /><br />
                                        </span>
                                    </ItemTemplate>
                                </asp:Repeater>      
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            
            <tr>
                <td align="right">
                <br />
                    <asp:Button ID="btnGravar" runat="server" Text="Gravar" Width="110px" onclick="btnGravar_Click" />&nbsp;&nbsp;
                    <asp:Button ID="btnFechar" runat="server" Text="Fechar" Width="110px" onclick="btnFechar_Click" />
                </td>
            </tr>
        </table>
        
        <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
        <script type="text/javascript">
            function validateRadUpload1(source, arguments) {
                arguments.IsValid = getRadUpload('<%= RadUpload1.ClientID %>').validateExtensions();
            }
        </script>
        </telerik:RadCodeBlock>
    </form>
</body>
</html>
